array = [1, 3, 8, 2, 3, 1, 3, 3, 3]

function solution(array) {
    // Edit your code here
    let Hash = {}
    let len = array.length
    array.forEach(item => {
        if (!Hash[item]) {
            Hash[item] = 1
        } else[
            Hash[item]++
        ]
    })
    console.log(Hash);
    for (let i in Hash) {
        if (Hash[i] > (len / 2)) {
            return parseInt(i)
        }
    }
}
console.log(solution(array));
